function fn(x: number, y: number): number {
  return x + y
}

fn(1, 2)


const fn1 = (x: number, y: number): number => x + y
const fn2: (x: number, y: number) => number = (x: number, y: number): number => x + y

interface Fn {
  (firstName: string, lastName?: string): string
}

const fn3: Fn = (firstName, lastName) => {
  if (lastName) {
    return firstName + lastName
  }
  return firstName 
}

fn3('aaa')
fn3('aaa', 'bbb')


const fn4 = (a: number, ...rest: number[]): void => {
  console.log(rest);
}